//
//  BVEmptyMyOrder.m
//  BuyVegetable
//
//  Created by zhuzi on 16/11/7.
//  Copyright © 2016年 com.yinding. All rights reserved.
//

#import "BVEmptyMyOrder.h"

@implementation BVEmptyMyOrder

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setChildView];
    }
    return self;
}
-(void)setChildView{
    
    self.backgroundColor = [UIColor BVBackgroundLightGrayColor];
    
    UILabel *titleLabel = [[UILabel alloc]init];
    [self addSubview:titleLabel];
    titleLabel.font = [UIFont systemFontOfSize:20];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.textColor = [UIColor BVTextLightGrayColor];
    titleLabel.text = @"您还没有订单哦~";
    titleLabel.sd_layout
    .topSpaceToView(self,100)
    .centerXIs(self.centerX)
    .heightIs(60);
    [titleLabel setSingleLineAutoResizeWithMaxWidth:200];
    
    UIButton *loginButton = [[UIButton alloc] init];
    [loginButton setTitle:@"马上去购物~" forState:UIControlStateNormal];
    [loginButton setBackgroundColor:[UIColor BVBaseOrangeColor]];
    loginButton.tag = 666;
    loginButton.layer.masksToBounds = YES;
    loginButton.layer.cornerRadius = 3.0;
    [loginButton addTarget:self action:@selector(shoppingClick:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:loginButton];
    loginButton.sd_layout
    .topSpaceToView(titleLabel,45)
    .centerXIs(self.centerX)
    .widthIs(120)
    .heightIs(40);
    
}
- (void)shoppingClick:(UIButton *)button {
    if (self.goShopBlock) {
        self.goShopBlock();
    }
}
@end
